<?php

namespace app\yue\model;

use think\Model;
use traits\model\SoftDelete;

class Common extends Model
{
    use SoftDelete;
    protected $deleteTime = 'delete_time';
    protected $autoWriteTimestamp = true;

    protected static function trimName($str)
    {

        $str = preg_replace_callback(
        '/./u',
        function (array $match) {
              return strlen($match[0]) >= 4 ? '' : $match[0];
        },
        $str);

        return mb_substr($str, 0, 5, 'utf8'); 
        // return substr($str, 0, 5);
    }
}
